Cosmetic: Avoid explicit state variables
authorMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 15:30:31 +0000 (10:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 17:32:57 +0000 (12:32 -0500)
Using the state of the context makes this more obviously correct.

gtk/gtktreeview.c

index 854583539836e481e0e70278475a8cee01d3aef1..a4bd8aaadb827e5b4b7030c0f26559ea80af9db1 100644 (file)
@@ -4854,12 +4854,10 @@ gtk_tree_view_draw_line (GtkTreeView         *tree_view,
 
     case GTK_TREE_VIEW_FOREGROUND_LINE:
       {
-        GtkStateFlags state;
         GdkRGBA color;
 
-        state = gtk_widget_get_state_flags (GTK_WIDGET (tree_view));
         cairo_set_line_width (cr, 1.0);
-        gtk_style_context_get_color (context, state, &color);
+        gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
         gdk_cairo_set_source_rgba (cr, &color);
       }
       break;